import { App } from 'vue';
import { registerPanelItemProvider } from '@ibiz-template/runtime';
import { withInstall } from '@ibiz-template/vue3-util';
import { SearchDisplayBarProvider } from './provider';
import { SearchDisplayBar } from './search-display-bar';

export const IBizSearchDisplayBar = withInstall(
  SearchDisplayBar,
  function (v: App) {
    v.component(SearchDisplayBar.name, SearchDisplayBar);
    registerPanelItemProvider(
      'CUSTOM_SearchDisplayBar',
      () => new SearchDisplayBarProvider(),
    );
    registerPanelItemProvider(
      'CUSTOM_SEARCH_DISPLAY_BAR',
      () => new SearchDisplayBarProvider(),
    );
  },
);

export default IBizSearchDisplayBar;
